So I started the machine learning tutorial and I already have a few questions about data frames. First, is there anything like a "data frame object" or is this just a type of array? More specifically:
df = Quandl.get("WIKI/GOOGL")
what type of object is df ?
Second , I tried both
print(df[["Adj. Close"]])
and
print(df["Adj. Close"])
so single and double brackets. They print almost the same thing, the one with double brackets prints the column label at the top, the one with single brackets prints it at the bottom. What is the difference between them ? Why and when do you use one or the other?
Thanks for your time. :)
You must be logged in to post. Please login or register an account.
a dataframe is a Pandas object.
Doing something like
print(df[["Adj. Close"]])
is worthless for the most part. The point of the double brackets is so you can reference multiple columns at a time. More like:
print(df[["Adj. Close","Adj. Open"]])
..for example. code]print(df["Adj. Close"]) Will just reference a single column, since it's not a list of columns.
-Harrison 8 years ago
You must be logged in to post. Please login or register an account.